﻿package com.etc.alipay;

import java.io.FileWriter;
import java.io.IOException;



/**
 * 支付宝接口的基础配置 设置账户相关信息
 * @author Administrator
 *
 */

public class AlipayConfig {
	


	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2016093000630467";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCVt5skG+dkKYYvkOLW1ZjzJGRBD93F07lU4eOskZUHFlNr7y9Wbif8vXNyw03vomTh/1vSK2A4baCbbuc/cSMo3+j1i+NuJpY6ihattzndU1yEcWZ0rJO3hO0PyGG7EMc+GxWOLkq3jroOTT6MQhvzKDY0rvGgywhooyGGftn+HAr1C1ZOohDmboVqBKySBbGhj0W0wVzHsVWpacR1e/vwA70M4jVZpMiRUgOHGuwYmtE4utXnhL3xhPD1mYbqrIn4rCnF0tdV+7tLmqu4XuFNZxQCr/34lpBm9xe7SedHmE++jjmZBQ5fL9bV1itPa8iwj3i+dZKe33IX41BbsvFhAgMBAAECggEABcXZno/Q4UTUnrrodD4yMpXho7yX4YvjZol7POk0JNzQhKXpXlzK/+zSKcesFqRdXXV6NeVkRWi8u6GQGxsiru3LTsSBFXs5abJvY21gNs+DDrxMpg0NeRMQDP69/feMpzFmKGBSkzdWpzyFP+VArKSNSoTAXmHVxiscHNKBV1HwWu00T8g5rRvu/LweFWFi8WxtINhxfdSQ9A28mLtdRfl1qm7FpD5tpXkBCTRQ3st7jWFq9QEFVNcn06pwTn9fOqAwux38d+UFTSxB1GFLvxgvl1MpWsa1BlXeuidcF6i/Wxjz8u8QjrIAn7GgK0Hqezs6VvlX+UNGT6R4WQlFfQKBgQDSlUne7fE2J37LoTjdUVVWmFEi81bd9w5Z9xFsOR1MAZmcN0kDtWn8CE4cinSMumUFGzEhEWQr8IcBqYg1fZjjF0zbossMCT+wQKxuxh99jcoq+U06PtD52huCU4FrjEq4hiAzr9kAeNVOUeDXwZB5c/2NPs0qUcRs8Y/Tlc+xNwKBgQC2AcnZv0GS/MXGey9pY8tfG4qqyCVE8Qx27FLO6zpRYOrSvQm8u5/P42pfUTRlVXZLRKUgR32i756JzoXSmPmK64/La8v235Qb1wFid1nRUml6j74S2hUINgyb/OWIfokoNHKTwCROJu4ahyzBLc9hwrp8WHwKbjUZUWc+N0meJwKBgErRugZX+izoiXdmF+Mig7SZt7I4TTPeFJ5IV0thW5RmuSI0zl9f9IEUnlQrqU9a5ouS5ri+Ch5GfmFLz9ZZgpmk7KzYwVXMb3F6+Qj+oa+lUiBEpXi9Wth68u0yKDiDBwVaulRC9VHinL8P/lgKMP/GA19M4e5YUPb4OMbPYpSvAoGADIOO91O5FHwgtQbfOaXM49sm65sbROQ18S9KekOeHN5HBvpMYxebY1XFiIwyyAzaN06e89s2fi9vfRYgCVzPO4f6uQfOXEj/C/L6e2StXkEGU5DyhqVL8OaWc1suBPZ+Q69neVUqqdzvXg+ROi8GJTiYTdhfnu/44qbALHzsqN0CgYAbkyUOS1CWZMw+J7cXqBrTBQ3Z8h34Kb1ZSOciZ/GRw5P/QIDwfhF7v5PBJ6Ft+QKvSwJn59g7BktLZhWBfy5OCTctAedIBFsuzUvXj3TdveilGemTwdjcC0Ml0sxJryiAHJeKhclfr5mZEnJwKLUNza2f7xUZmmTAdoG1kCA7UQ==";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlbebJBvnZCmGL5Di1tWY8yRkQQ/dxdO5VOHjrJGVBxZTa+8vVm4n/L1zcsNN76Jk4f9b0itgOG2gm27nP3EjKN/o9YvjbiaWOooWrbc53VNchHFmdKyTt4TtD8hhuxDHPhsVji5Kt466Dk0+jEIb8yg2NK7xoMsIaKMhhn7Z/hwK9QtWTqIQ5m6FagSskgWxoY9FtMFcx7FVqWnEdXv78AO9DOI1WaTIkVIDhxrsGJrROLrV54S98YTw9ZmG6qyJ+KwpxdLXVfu7S5qruF7hTWcUAq/9+JaQZvcXu0nnR5hPvo45mQUOXy/W1dYrT2vIsI94vnWSnt9yF+NQW7LxYQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://192.168.11.226:8080/pet_fostering/frontdevel/appliy/notify_url.jsp";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://192.168.11.226:8080/pet_fostering/frontdevel/appliy/return_url.jsp";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关https://openapi.alipaydev.com/gateway.do
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";



    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

